#include "mpoint.h"
#ifdef GUI_APPLICATION

#include "mmath.h"

void MPoint::move(int x, int y)
{
	_x = x;
	_y = y;
}

void MPoint::move(const MPoint &other)
{
	_x = other._x;
	_y = other._y;
}

int MPoint::distanceFrom(const MPoint &other) const
{
	int RAS1 = _x - other._x;
	if( RAS1 < 0 )
		RAS1 = -RAS1;

	int RAS2 = _y - other._y;
	if( RAS2 < 0 )
		RAS2 = -RAS2;

	return Geometry::r_RT_PT(RAS1, RAS2);
}

const MPoint &MPoint::operator=(const MPoint &other)
{
	_x = other._x;
	_y = other._y;
	return *this;
}


#endif //GUI_APPLICATION
